package com.cfec.educationplatform.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 题库表
 * @TableName tb_practice
 */
@TableName(value ="tb_practice")
@Data
public class TbPractice {
    /**
     * id
     */
    @TableId
    private Long practiceId;

    /**
     * 年级：小学x年级(e_x，x为1到6)；
初中x年级（j_x，x为1到3）；
高中x年级（h_x，x为1到3);
大学x年级（u_x，x为1到4）
     */
    private String practiceGrade;

    /**
     * 科目:0:数学；1:物理；2:化学；3:英语
     */
    private String practiceSubjects;

    /**
     * 题目类型：0：选择题；1：填空题；2：计算题；3：简答题
     */
    private String practiceClassify;

    /**
     * 难度：0：简单；1：中等；2：困难
     */
    private String practiceDifficult;

    /**
     * 题目信息
     */
    private String practiceInfo;

    /**
     * 该题的解析
     */
    private String practiceParse;

    /**
     * 答案
     */
    private String practiceAnswer;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 信息状态：0：弃用，1：使用
     */
    private String practiceState;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbPractice other = (TbPractice) that;
        return (this.getPracticeId() == null ? other.getPracticeId() == null : this.getPracticeId().equals(other.getPracticeId()))
            && (this.getPracticeGrade() == null ? other.getPracticeGrade() == null : this.getPracticeGrade().equals(other.getPracticeGrade()))
            && (this.getPracticeSubjects() == null ? other.getPracticeSubjects() == null : this.getPracticeSubjects().equals(other.getPracticeSubjects()))
            && (this.getPracticeClassify() == null ? other.getPracticeClassify() == null : this.getPracticeClassify().equals(other.getPracticeClassify()))
            && (this.getPracticeDifficult() == null ? other.getPracticeDifficult() == null : this.getPracticeDifficult().equals(other.getPracticeDifficult()))
            && (this.getPracticeInfo() == null ? other.getPracticeInfo() == null : this.getPracticeInfo().equals(other.getPracticeInfo()))
            && (this.getPracticeParse() == null ? other.getPracticeParse() == null : this.getPracticeParse().equals(other.getPracticeParse()))
            && (this.getPracticeAnswer() == null ? other.getPracticeAnswer() == null : this.getPracticeAnswer().equals(other.getPracticeAnswer()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getPracticeState() == null ? other.getPracticeState() == null : this.getPracticeState().equals(other.getPracticeState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPracticeId() == null) ? 0 : getPracticeId().hashCode());
        result = prime * result + ((getPracticeGrade() == null) ? 0 : getPracticeGrade().hashCode());
        result = prime * result + ((getPracticeSubjects() == null) ? 0 : getPracticeSubjects().hashCode());
        result = prime * result + ((getPracticeClassify() == null) ? 0 : getPracticeClassify().hashCode());
        result = prime * result + ((getPracticeDifficult() == null) ? 0 : getPracticeDifficult().hashCode());
        result = prime * result + ((getPracticeInfo() == null) ? 0 : getPracticeInfo().hashCode());
        result = prime * result + ((getPracticeParse() == null) ? 0 : getPracticeParse().hashCode());
        result = prime * result + ((getPracticeAnswer() == null) ? 0 : getPracticeAnswer().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getPracticeState() == null) ? 0 : getPracticeState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", practiceId=").append(practiceId);
        sb.append(", practiceGrade=").append(practiceGrade);
        sb.append(", practiceSubjects=").append(practiceSubjects);
        sb.append(", practiceClassify=").append(practiceClassify);
        sb.append(", practiceDifficult=").append(practiceDifficult);
        sb.append(", practiceInfo=").append(practiceInfo);
        sb.append(", practiceParse=").append(practiceParse);
        sb.append(", practiceAnswer=").append(practiceAnswer);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", practiceState=").append(practiceState);
        sb.append("]");
        return sb.toString();
    }
}